<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>餐食列表</title>
</head>
<body>
	<h1>餐食列表</h1>
	<hr />
	<c:if test="${!empty user }">
		欢迎你：${user.name }
		<a href="../authorization/remove">登出</a>
	</c:if>
	<hr />

	<ul style="color: red">
		<c:forEach items="${errors }" var="error">
			<li>${error }</li>
		</c:forEach>
	</ul>

	<ul>
		<c:set scope="page" var="products" value="${data.items }"></c:set>
		<c:forEach var="product" items="${products }">
			<li>${product.id },${product.name },${product.price }<a
				href="../product/get?id=${product.id }">详细</a> <a
				href="../product/edit?id=${product.id }">修改</a> <a
				href="../product/delete?id=${product.id }">删除</a></li>
		</c:forEach>
	</ul>


	<c:forEach var="page" begin="1" end="${data.totalPage }">
		<a style="font-size: ${page == data.currentPage? 18 : 12 }px;"
			href="../product/list?page=${page }">${page }</a>
	</c:forEach>


	<hr />
	<a href="../product/input">新增餐食</a>
	<hr />
	<a href="../home">返回</a>
</body>
</html>